<LINK rel=stylesheet type=text/css href="pages/content/custManager/customerGroupManager/customerGroupManager.css"/>
<div id="customerGroup">
    <yu-panel title="营销客群管理" :hide-filter="false">
        <template slot="right">
            <yu-button-drop>
                <el-button @click="custGroupEdit" v-if="custGroupEditButton">修改</el-button>
                <el-button @click="custGroupDelete" v-if="custGroupDeleteButton">删除</el-button>
                <el-button @click="custGroupSendMessage" v-if="custGroupSendMessageButton">发送短信</el-button>
            </yu-button-drop>
        </template>
        <template slot="filter">
            <yu-xform v-model="formdata" related-table-name="custGroupTable" form-type="search" label-width="110px">
                <yu-xform-group :column="4">
                    <yu-xform-item label="客群名称" placeholder="客群名称" v-model="formdata.custGroupName" ctype="input"
                                   name="custGroupName"></yu-xform-item>
                </yu-xform-group>
            </yu-xform>
        </template>
        <!-- <el-table-x ref="custGroupTable" :checkbox="true" :max-height="height" :data-url="groupDataUrl"
                    :base-params="groupDataParams"
                    :table-columns="tableColumns">
        </el-table-x> -->
		<yu-xtable ref="custGroupTable" row-number :data-url="groupDataUrl" selection-type="checkbox" :pageable=true
		 :base-params="groupDataParams">
			<yu-xtable-column label="主键" prop="id" v-if="false"></yu-xtable-column>
			<yu-xtable-column label="客群编号" prop="custGroupNo" show-overflow-tooltip width="200" sortable></yu-xtable-column>
			<yu-xtable-column label="客群名称" prop="custGroupName" width="150" sortable></yu-xtable-column>
			<yu-xtable-column label="客群状态" prop="custGroupStatus" width="140" data-code="CUST_GROUP_STATE" sortable></yu-xtable-column>
			<yu-xtable-column label="客户数量" prop="custGroupNum" width="160" sortable></yu-xtable-column>
			<yu-xtable-column label="创建时间" prop="createTime"  width="150"></yu-xtable-column>
			<yu-xtable-column label="创建人" prop="createUserName" width="120" sortable></yu-xtable-column>
			<yu-xtable-column fixed="right" label="操作">
				<template slot-scope="scope">
					<yu-button @click="handleClick(scope.row)" type="text" size="small">客户明细</yu-button>
				</template>
			</yu-xtable-column>
		</yu-xtable>
		
    </yu-panel>
	
	<el-dialog-x title="客户明细" :visible.sync="custInfoDialogVisible" width="1000px">
		<yu-xform label-width="1000px" ref="custInfoTable" v-model="custInfoData" :disabled="true">
			<yu-xtable :data-url="custInfoUrl" :pageable=true :base-params="custInfoParams">
				<yu-xtable-column label="客户号" prop="custNo" show-overflow-tooltip width="200" sortable></yu-xtable-column>
				<yu-xtable-column label="客户名称" prop="custName" width="200" sortable></yu-xtable-column>
				<yu-xtable-column label="手机号" prop="mobNo" width="200" sortable></yu-xtable-column>
				<yu-xtable-column label="网格名称" prop="gridName" sortable></yu-xtable-column>
			</yu-xtable>
		</yu-xform>
	</el-dialog-x>
    <el-dialog :center="true" title="营销客群信息" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
        <el-form-x ref="datafilterForm" :group-fields="updateFields" :buttons="updateButtons" :disabled="formDisabled"
                   label-width="120px"></el-form-x>
    </el-dialog>

    <el-dialog :center="true" title="短信模板" :visible.sync="addVisible">
        <yu-xform ref="templetForm" label-width="120px" label-suffix=":">
            <yu-xform-group :column="1">
                <yu-xform-item maxlength="10" show-word-limit placeholder="短信模版" rules="required" label="短信模板"
                               ctype="select" name="modelType" data-code="MODEL_TYPE"
                               @change="getTemInfo($event)"></yu-xform-item>
                <yu-xform-item show-word-limit placeholder="模板内容" rules="required" label="模板内容" ctype="textarea"

                               name="modelInfo"></yu-xform-item>
                <yu-xform-item label="审核员" ctype="select" name="approverNo" rules="required"
                               colspan="12" :data-url="messageApproveUrl"
                               :data-params="messageApproveParam"></yu-xform-item>
            </yu-xform-group>
            <div class="formButtonGroup">
                <el-button type="primary" v-loading="loading" @click="addSubmit">确定</el-button>
                <el-button type="primary" @click="addCancel">取消</el-button>
            </div>
        </yu-xform>
    </el-dialog>
</div>
